-- Make sure only one record for each property name
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(CFG_SWEEP_PROPERTIES_SEQ.nextVal, 'ONWATCH_CMD_DIR', 'test/');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(CFG_SWEEP_PROPERTIES_SEQ.nextVal, 'ONWATCH_CMD_FILE', 'test_cmd_file.xml');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(CFG_SWEEP_PROPERTIES_SEQ.nextVal, 'ONWATCH_USER', 'root');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(CFG_SWEEP_PROPERTIES_SEQ.nextVal, 'IS_DYNAMIC', 'true');
INSERT INTO AUTOSC.CFG_SWEEP_PROPERTIES (SWEEP_PROP_ID, PROP_NAME, PROP_VALUE)
	VALUES(CFG_SWEEP_PROPERTIES_SEQ.nextVal, 'IS_DEBUG', 'true');
	
INSERT INTO AUTOSC.CFG_IIP_VERSION_CONN_INFO (MODEL_TYPE, IIP_VERSION, CONN_TYPE)
	VALUES('_TST-LNX1', '4.0', 'ONWATCH');	
	
-- Make sure only one record for each file Id and name	
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (CFG_ONWATCH_FILE_INFO_ID_SEQ.nextVal, 'File1', '/ascpdata3/iipTest', 'supportFile1', 'PUT', 'BINARY');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (CFG_ONWATCH_FILE_INFO_ID_SEQ.nextVal, 'File2', '/ascpdata3/iipTest', 'supportFile2', 'PUT', 'BINARY');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (CFG_ONWATCH_FILE_INFO_ID_SEQ.nextVal, 'File3', '/ascpdata3/iipTest', 'test.tar.gz', 'PUT', 'BINARY');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (CFG_ONWATCH_FILE_INFO_ID_SEQ.nextVal, 'File4', '/ascpdata3/iipTest', 'uploadFile4', 'GET', 'ASCII');
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (CFG_ONWATCH_FILE_INFO_ID_SEQ.nextVal, 'File5', '/ascpdata3/iipTest', 'uploadFile5', 'GET', 'ASCII');			
INSERT INTO CFG_ONWATCH_FILE_INFO (ONWATCH_FILE_ID, FILE_ID, FILE_DIRECTORY, FILE_NAME, DIRECTION, FILE_TYPE)
	VALUES (CFG_ONWATCH_FILE_INFO_ID_SEQ.nextVal, 'File6', '/ascpdata3/iipTest', 'uploadFile6', 'GET', 'ASCII');
	
	
INSERT INTO AUTOSC.CFG_REQUEST_TYPE (request_type_id, request_type_name, is_requestable) VALUES (CFG_REQUEST_TYPE_SEQ.nextVal, 'onwatchTestSweep', 'Y'); 

INSERT INTO AUTOSC.CFG_TASK_TYPE ( TASK_TYPE_ID, TASK_TYPE_NAME, TASK_CATEGORY_ID, MAX_RETRY_COUNT, CODE_GROUP, EXT_AUTOSC, PRIORITY, RUNTIME_LENGTH) 
	VALUES (CFG_TASK_TYPE_SEQ.nextVal , 'ONWATCH_SWEEP_TASK_TYPE', 
	(SELECT task_category_id from AUTOSC.CFG_TASK_CATEGORY_INFO where TASK_CATEGORY = 'ONWATCH'),
	 0, 'A', 'T', 1, 1440);
INSERT INTO AUTOSC.CFG_TASK_TYPE ( TASK_TYPE_ID, TASK_TYPE_NAME, TASK_CATEGORY_ID, MAX_RETRY_COUNT, CODE_GROUP, EXT_AUTOSC, PRIORITY, RUNTIME_LENGTH) 
	VALUES (CFG_TASK_TYPE_SEQ.nextVal , 'ONWATCH_FT_TASK_TYPE', 
	(SELECT task_category_id from AUTOSC.CFG_TASK_CATEGORY_INFO where TASK_CATEGORY = 'ONWATCH'),
	0, 'S', 'F', 1, 1440);

INSERT INTO AUTOSC.CFG_TASK_FT_DETAILS (TASK_TYPE_NAME, LOG_FILE_PATTERN, ORDERING, TEMPLATE_DEF)
	VALUES ('ONWATCH_FT_TASK_TYPE', 'uploadFile*', 1, '/ascpdata3/Onwatch/gsp/testResult'); 	

INSERT INTO AUTOSC.CFG_TASK_CLASS_MAP (TASK_CLASS_MAP_ID, TASK_TYPE_NAME, TASK_CLASS)
	VALUES (CFG_TASK_CLASS_MAP_ID_SEQ.nextVal, 'ONWATCH_FT_TASK_TYPE', 'fileCopyTask'); 

INSERT INTO AUTOSC.CFG_TASK_RELATIONSHIP (RELATION_ID, PARENT_ID, CHILD_ID) VALUES (AUTOSC.CFG_TASK_RELATIONSHIP_SEQ.nextval, 
	(select task_type_id from AUTOSC.cfg_task_type where task_type_name = 'ONWATCH_SWEEP_TASK_TYPE'),
	(select task_type_id from AUTOSC.cfg_task_type where task_type_name = 'ONWATCH_FT_TASK_TYPE'));

INSERT INTO AUTOSC.CFG_REQUEST_DEFN (REQUEST_DEFN_ID, REQUEST_TYPE_ID, MODALITY, MODEL_TYPE, REQUEST_DESC, INITIAL_TASK_ID, VERIFIER, REQUESTER, EXPIRES_ON) 
	VALUES(CFG_REQUEST_DEFN_SEQ.nextVal, 
		(select request_type_id from AUTOSC.cfg_request_type where request_type_name = 'onwatchTestSweep'),
		'GSP', '_TST-LNX1', 'ONWATCH_SWEEP_REQUEST', 
		(select task_type_id from AUTOSC.cfg_task_type where task_type_name = 'ONWATCH_SWEEP_TASK_TYPE'),
		 'faichun.siu@ge.com', 'faichun.siu@ge.com', sysdate + 12000);
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select sweep_prop_id from cfg_sweep_properties where prop_name = 'ONWATCH_CMD_DIR'));
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select sweep_prop_id from cfg_sweep_properties where prop_name = 'ONWATCH_CMD_FILE'));
INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select sweep_prop_id from cfg_sweep_properties where prop_name = 'ONWATCH_USER'));

INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'),
						(select sweep_prop_id from cfg_sweep_properties where prop_name = 'IS_DYNAMIC'));

INSERT INTO CFG_REQUEST_DEFN_TO_SWEEP_PROP (REQUEST_DEFN_ID, SWEEP_PROP_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'),
						(select sweep_prop_id from cfg_sweep_properties where prop_name = 'IS_DEBUG'));

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select onwatch_file_id from cfg_onwatch_file_info where file_id = 'File1' and file_name = 'supportFile1'));

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select onwatch_file_id from cfg_onwatch_file_info where file_id = 'File2' and file_name = 'supportFile2'));	

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select onwatch_file_id from cfg_onwatch_file_info where file_id = 'File3' and file_name = 'test.tar.gz'));

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select onwatch_file_id from cfg_onwatch_file_info where file_id = 'File4' and file_name = 'uploadFile4'));

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'), 
						(select onwatch_file_id from cfg_onwatch_file_info where file_id = 'File5' and file_name = 'uploadFile5'));

INSERT INTO CFG_REQ_DEFN_TO_ONWATCH_FI (REQUEST_DEFN_ID, ONWATCH_FILE_ID)
	VALUES ((select request_defn_id from cfg_request_defn where request_desc = 'ONWATCH_SWEEP_REQUEST' and modality='GSP' and model_type = '_TST-LNX1'),
						(select onwatch_file_id from cfg_onwatch_file_info where file_id = 'File6' and file_name = 'uploadFile6'));
		    	